/* BEM support Func
 -------------------------- */

@function containsModifier($selector) {
  $selector: selectortostring($selector);

  @if str-index($selector, $rd-modifier-separator) {
    @return true;
  } @else {
    @return false;
  }
}

@function containThemeFlag($selector) {
  $selector: selectortostring($selector);

  @if str-index($selector, '.' + $rd-theme-prefix) {
    @return true;
  } @else {
    @return false;
  }
}

@function containWhenFlag($selector) {
  $selector: selectortostring($selector);

  @if str-index($selector, '.' + $rd-state-prefix) {
    @return true;
  } @else {
    @return false;
  }
}

@function containPseudoClass($selector) {
  $selector: selectortostring($selector);

  @if str-index($selector, ':') {
    @return true;
  } @else {
    @return false;
  }
}

@function hitAllSpecialNestRule($selector) {
  @return containsModifier($selector) or containThemeFlag($selector) or containWhenFlag($selector) or containPseudoClass($selector);
}
